<!DOCTYPE html>
<link rel='stylesheet' href="{{ url_for('static', filename='main.css') }}">

<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>{% block title %}{% endblock %}</title>
        <link rel="stylesheet" href="http://labfile.oss.aliyuncs.com/courses/923/week7/code/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    </head>
    <body>
   <nav class="navbar navbar-inverse">
  <div class="container">
   
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="/">Simpledu</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav">
        <li class="active"><a href="/">课程<span class="sr-only">(current)</span></a></li>
        <li><a href="#">直播</a></li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
    {% if not current_user.is_authenticated %}       
        <li><a href="{{ url_for('front.register') }}">注册</a></li>
        <li><a href="{{ url_for('front.login') }}">登录</a></li>
    {% else %}
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ current_user.username }}<span class="caret"></span></a>
        <ul class="dropdown-menu">
            <li><a href="#">个人主页</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="{{ url_for('front.logout') }}">退出登录</a></li>

        </ul>
    </li>
    {% endif %}
    </ul>
    </div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav> 
      <div class="container">
         {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
        {% for category, message in messages %}
        <div class="alert alert-{{ category }} alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            {{ message }}
        </div>
        {% endfor %}
        {% endif %}
    {% endwith %}
    
        {% block body %}{% endblock %}
        {% block footer %}{% endblock %}
      </div>
      <!-- Bootstrap 依赖 jQuery -->
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
      <script src="http://labfile.oss.aliyuncs.com/courses/923/week7/code/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    </body>    
</html>    
</html>

